From: Jasper St. Pierre Date: Sat, 14 Jul 2012 23:30:47 +0000 (-0400) Subject: lookingGlass: Use one red border effect X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~6315 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=360e6e790a15fa44c04abf8e5b7aa705366db8a0;p=gnome-shell.git lookingGlass: Use one red border effect This makes the code a bit cleaner, and reduces the chances of having a border effect "leaking", or having two at the same time. https://bugzilla.gnome.org/show_bug.cgi?id=679944 --- diff --git a/js/ui/lookingGlass.js b/js/ui/lookingGlass.js index 3a61227a8..c90da5537 100644 --- a/js/ui/lookingGlass.js +++ b/js/ui/lookingGlass.js @@ -519,9 +519,6 @@ const Inspector = new Lang.Class({ this._displayText = new St.Label(); eventHandler.add(this._displayText, { expand: true }); - this._borderPaintTarget = null; - this._redBorderEffect = new RedBorderEffect(); - eventHandler.connect('destroy', Lang.bind(this, this._onDestroy)); eventHandler.connect('key-press-event', Lang.bind(this, this._onKeyPressEvent)); eventHandler.connect('button-press-event', Lang.bind(this, this._onButtonPressEvent)); eventHandler.connect('scroll-event', Lang.bind(this, this._onScrollEvent)); @@ -565,11 +562,6 @@ const Inspector = new Lang.Class({ this.emit('closed'); }, - _onDestroy: function() { - if (this._borderPaintTarget != null) - this._borderPaintTarget.remove_effect(this._redBorderEffect); - }, - _onKeyPressEvent: function (actor, event) { if (event.get_key_symbol() == Clutter.Escape) this._close(); @@ -638,13 +630,7 @@ const Inspector = new Lang.Class({ this._displayText.text = ''; this._displayText.text = position + ' ' + this._target; - if (this._borderPaintTarget != this._target) { - if (this._borderPaintTarget != null) - this._borderPaintTarget.remove_effect(this._redBorderEffect); - this._borderPaintTarget = this._target; - if (this._borderPaintTarget != null) - this._borderPaintTarget.add_effect(this._redBorderEffect); - } + this._lookingGlass.setBorderPaintTarget(this._target); } }); @@ -979,7 +965,7 @@ const LookingGlass = new Lang.Class({ + 'font-family: "' + fontDesc.get_family() + '";'; }, - _setBorderPaintTarget: function(obj) { + setBorderPaintTarget: function(obj) { if (this._borderPaintTarget != null) this._borderPaintTarget.remove_effect(this._redBorderEffect); this._borderPaintTarget = obj; @@ -993,7 +979,7 @@ const LookingGlass = new Lang.Class({ this._results.push(result); this._resultsArea.add(result.actor); if (obj instanceof Clutter.Actor) - this._setBorderPaintTarget(obj); + this.setBorderPaintTarget(obj); let children = this._resultsArea.get_children(); if (children.length > this._maxItems) { @@ -1175,7 +1161,7 @@ const LookingGlass = new Lang.Class({ this._open = false; Tweener.removeTweens(this.actor); - this._setBorderPaintTarget(null); + this.setBorderPaintTarget(null); Main.popModal(this._entry);